<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<html>
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #d2e3ff;
}
-->
</style>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	//登录非空验证
	function authLogin() {
		username = document.login.username;
		pwd = document.login.password;
		code = document.login.randcode;
		if (username.value.length == 0) {
			alert("用户名不能为空");
			username.focus();
			return;
		} else if (pwd.value.length == 0) {
			alert("密码不能为空");
			pwd.focus();
			return;
		}else if(code.value.length==0){
			alert("验证码不能为空");
			code.focus();
			return;
		}
        document.forms[0].submit();
	}

	//验证码刷新
	function reLoadImage() {
		document.getElementById("img_rand_code").src = "${ctx}/image.action?r=" + Math.random();
	}
</script>
</head>
<body>
<script>
	<c:if test="${not empty adminTimeout}">
		parent.window.location="./admin.jsp";
	</c:if>
</script>
<div id="loginin"><div id="signup">
<form action="admin.action" method="post" name="login">
<span><c:if test="${not empty loginMsg}"><font color="red">${loginMsg }</font></c:if></span>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td width="21%">用户名</td>
    <td width="79%"><input type="text" name="username" class="inputInput" /></td>
  </tr>
  <tr>
    <td>密&nbsp;&nbsp;码</td>
    <td><input type="password" name="password"  class="inputInput"/></td>
  </tr>
  <tr>
    <td>验证码</td>
    <td><input type="text" name="randcode" style="padding:0; border:1px #6b8ca8 solid; background:#fff; width:35%;" onkeypress="if(event.keyCode==13) {imageField.click();return false;}"/>
    	<img title="单击刷新验证码" id="img_rand_code" onclick="reLoadImage();" src="${ctx}/image.action" />
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><label>
        <input name="imageField" id="imageField" type="image" onclick="authLogin();" src="images/button_login.gif" />
    </label></td>
  </tr>
</table>
</form>
</div></div>
</body>
</html>